﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartCard.Framework
{
	/// <summary>
	/// Operation that will be executed against a card.  Tracks the history of operations that
	/// were executed against 
	/// </summary>
	/// <typeparam name="T">
	/// type of data this card function returns
	/// </typeparam>
	public abstract class CardOperation<T>
	{
		#region properties

		protected ICard Card
		{ get; private set; }

		#endregion

		#region construction

		public CardOperation(ICard card)
		{
			if (card == null)
			{ throw new ArgumentNullException("card"); }

			Card = card;
		}

		#endregion

		/// <summary>
		/// Executes the card function returning the appropriate respone
		/// </summary>
		/// <returns></returns>
		public abstract T Execute();
	}
}
